import Main from '@/view/main'
import Mains from '@/view/main/mains'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [{
        path: '/admin-view/login',
        name: 'login',
        meta: {
            title: 'Login - 登录',
            hideInMenu: true,
        },
        component: () =>
            import('@/view/login/login.vue'),
    },
    {
        path: '/admin-view/home',
        name: 'home',
        redirect: '/admin-view/home',
        component: Main,
        meta: {
            access: ['home'],
            //hideInMenu: true,
            notCache: true,
        },
        children: [{
            path: '/admin-view/home',
            name: 'home',
            meta: {
                access: ['home'],
                icon: 'md-home',
                title: '首页',
                notCache: true,
            },
            component: () =>
                import('@/view/single-page/home'),
        }, ],
    },
    {
        path: '/admin-view/form_info',
        name: 'form_info',
        meta: {
            access: ['form_type_list', 'form_list'],
            icon: 'ios-chatboxes',
            title: '表单管理',
        },
        component: Main,
        children: [{
                path: 'form_type_list',
                name: 'form_type_list',
                meta: {
                    access: ['form_type_list'],
                    icon: 'md-reorder',
                    title: '类型列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/form/form_type_list.vue'),
            },
            {
                path: 'form_list/:code?',
                name: 'form_list',
                meta: {
                    access: ['form_list'],
                    icon: 'md-reorder',
                    title: '表单列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/form/form_list.vue'),
            },
        ],
    },
    {
        path: '/admin-view/repair_manger',
        name: 'repair_manger',
        meta: {
            access: ['task_list', 'task_repair_list', 'device_list', 'repair_evaluate'],
            icon: 'md-compass',
            title: '抢修服务',
        },
        component: Main,
        children: [{
                path: 'task_list',
                name: 'task_list',
                meta: {
                    access: ['task_list'],
                    icon: 'md-reorder',
                    title: '抢修任务列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/task_list.vue'),
            },
            {
                path: 'task_repair_list',
                name: 'task_repair_list',
                meta: {
                    access: ['task_repair_list'],
                    icon: 'md-reorder',
                    title: '抢修订单管理',
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/task_repair_list.vue'),
            },
            {
                path: 'repair_user_list/:rid',
                name: 'repair_user_list',
                meta: {
                    icon: 'md-reorder',
                    title: '抢修队人员管理',
                    hideInMenu: true,
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/repair_user_list.vue'),
            },
            {
                path: 'device_list',
                name: 'device_list',
                meta: {
                    access: ['device_list'],
                    icon: 'md-reorder',
                    title: '设备类型',
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/device_list.vue'),
            },
            {
                path: 'gz_list/:pid',
                name: 'gz_list',
                meta: {
                    icon: 'ios-reorder',
                    title: '故障类型',
                    hideInMenu: true,
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/gz_list.vue'),
            },
            {
                path: 'repair_evaluate',
                name: 'repair_evaluate',
                meta: {
                    access: ['repair_evaluate'],
                    icon: 'md-reorder',
                    title: '评价管理',
                    notCache: true,
                },
                component: () =>
                    import('@/view/repair/repair_evaluate.vue'),
            }
        ],
    },
    {
        path: '/admin-view/good',
        name: 'good',
        meta: {
            access: ['good_cate', 'good_list', 'good_list_app'],
            icon: 'logo-buffer',
            title: '租赁管理',
        },
        component: Main,
        children: [{
                path: 'good_cate',
                name: 'good_cate',
                meta: {
                    access: ['good_cate'],
                    icon: 'md-reorder',
                    title: '商品分类',
                    notCache: true,
                },
                component: () =>
                    import('@/view/good/good_cate.vue'),
            },
            {
                path: 'good_list',
                name: 'good_list',
                meta: {
                    access: ['good_list'],
                    icon: 'md-reorder',
                    title: '商品发布',
                    notCache: true,
                },
                component: () =>
                    import('@/view/good/good_list.vue'),
            },
            {
                path: 'good_list_app',
                name: 'good_list_app',
                meta: {
                    access: ['good_list_app'],
                    icon: 'md-reorder',
                    title: '用户提交',
                    notCache: true,
                },
                component: () =>
                    import('@/view/good/good_list_app.vue'),
            },
            {
                path: 'order_list',
                name: 'order_list',
                meta: {
                    access: ['order_list'],
                    icon: 'md-reorder',
                    title: '订单列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/order/order_list.vue'),
            },
            {
                path: 'order_list_offline',
                name: 'order_list_offline',
                meta: {
                    access: ['order_list_offline'],
                    icon: 'md-reorder',
                    title: '线下租赁订单',
                    notCache: true
                },
                component: () =>
                    import('@/view/order/order_list_offline.vue'),
            },
            {
                path: 'specs_type_list',
                name: 'specs_type_list',
                meta: {
                    access: ['specs_type_list'],
                    icon: 'md-reorder',
                    title: '类型列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/good/specs_type_list.vue'),
            },
            {
                path: 'specs_list',
                name: 'specs_list',
                meta: {
                    access: ['specs_list'],
                    icon: 'md-reorder',
                    title: '规格列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/good/specs_list.vue'),
            },
        ],
    },
    {
        path: '/admin-view/article',
        name: 'article',
        meta: {
            access: ['article_cate', 'article_list'],
            icon: 'ios-chatboxes',
            title: '资讯管理',
        },
        component: Main,
        children: [{
                path: 'article_cate',
                name: 'article_cate',
                meta: {
                    access: ['article_cate'],
                    icon: 'md-reorder',
                    title: '资讯分类',
                    notCache: true,
                },
                component: () =>
                    import('@/view/article/article_cate.vue'),
            },
            {
                path: 'article_list',
                name: 'article_list',
                meta: {
                    access: ['article_list'],
                    icon: 'md-reorder',
                    title: '资讯列表',
                    notCache: true,
                },
                component: () =>
                    import('@/view/article/article_list.vue'),
            },
        ],
    },
    {
        path: '/admin-view/company',
        name: 'company',
        meta: {
            access: ['company_list'],
            icon: 'ios-chatboxes',
            title: '施工单位',
        },
        component: Main,
        children: [{
            path: 'company_list',
            name: 'company_list',
            meta: {
                access: ['company_list'],
                icon: 'md-reorder',
                title: '施工单位',
                notCache: true,
            },
            component: () =>
                import('@/view/company/company_list.vue'),
        }, ],
    },
    {
        path: '/admin-view/contract',
        name: 'contract',
        meta: {
            access: ['contract_list'],
            icon: 'ios-chatboxes',
            title: '台账管理',
        },
        component: Main,
        children: [{
            path: 'contract_list',
            name: 'contract_list',
            meta: {
                access: ['contract_list'],
                icon: 'md-reorder',
                title: '台账管理',
                notCache: true,
            },
            component: () =>
                import('@/view/contract/index.vue'),
        }, ],
    },
    {
        path: '/admin-view/company_wt',
        name: 'company_wt',
        meta: {
            access: ['company_wt_list'],
            icon: 'ios-chatboxes',
            title: '委托单位',
        },
        component: Main,
        children: [{
            path: 'company_wt_list',
            name: 'company_wt_list',
            meta: {
                access: ['company_wt_list'],
                icon: 'md-reorder',
                title: '委托单位',
                notCache: true,
            },
            component: () =>
                import('@/view/company/company_wt_list.vue'),
        }, ],
    },
    {
        path: '/admin-view/privilege_manager',
        name: 'auth_manager',
        meta: {
            access: ['role_list', 'privilege_list', 'user-manage'],
            title: '账号管理',
            icon: 'md-archive',
        },
        component: Main,
        children: [{
                path: 'privilege_list',
                name: 'privilege_list',
                meta: {
                    access: ['privilege_list'],
                    icon: 'ios-hammer',
                    title: '权限管理',
                    //hideInMenu: true
                },
                component: () =>
                    import('@/view/privilege/auth_list'),
            },
            {
                path: 'role_list',
                name: 'role_list',
                meta: {
                    access: ['role_list'],
                    icon: 'ios-ribbon',
                    title: '角色管理',
                },
                component: () =>
                    import('@/view/privilege/role_list'),
            },
            {
                path: 'add_role',
                name: 'add_role',
                meta: {
                    title: '创建角色',
                    notCache: true,
                    hideInMenu: true,
                    icon: 'ios-create',
                },
                component: () =>
                    import('@/view/privilege/add_role'),
            },
            {
                path: 'edit_role/:name',
                name: 'edit_role',
                meta: {
                    title: '编辑角色',
                    notCache: true,
                    hideInMenu: true,
                    icon: 'ios-create',
                },
                component: () =>
                    import('@/view/privilege/edit_role'),
            },
            {
                path: 'user-manage-list',
                name: 'user-manage-list',
                meta: {
                    access: ['user-manage'],
                    icon: 'md-grid',
                    title: '账号管理',
                    notCache: true,
                    type: 10,
                    is_vest: -1
                },
                component: () =>
                    import('@/view/user/list.vue'),
            },
        ],
    },
    {
        path: '/admin-view/system_manger',
        name: 'system_manger',
        meta: {
            access: ['setting', 'user_list', 'user_auth', 'ad_list', 'feed_back'],
            icon: 'md-settings',
            title: '系统管理',
        },
        component: Main,
        children: [{
                path: 'setting',
                name: 'setting',
                meta: {
                    access: ['setting'],
                    icon: 'md-reorder',
                    title: '参数设置',
                    notCache: true,
                },
                component: () =>
                    import('@/view/system/setting.vue'),
            },
            {
                path: 'user_list',
                name: 'user_list',
                meta: {
                    access: ['user_list'],
                    icon: 'md-reorder',
                    title: '用户管理',
                    notCache: true,
                },
                component: () =>
                    import('@/view/system/user_list.vue'),
            },
            {
                path: 'user_auth',
                name: 'user_auth',
                meta: {
                    access: ['user_auth'],
                    icon: 'md-reorder',
                    title: '企业认证',
                    notCache: true,
                },
                component: () =>
                    import('@/view/system/user_auth.vue'),
            },
            {
                path: 'ad_list',
                name: 'ad_list',
                meta: {
                    access: ['ad_list'],
                    icon: 'md-reorder',
                    title: '广告管理',
                    notCache: true,
                },
                component: () =>
                    import('@/view/ad/ad_list.vue'),
            },
            {
                path: 'feed_back',
                name: 'feed_back',
                meta: {
                    access: ['feed_back'],
                    icon: 'md-apps',
                    title: '意见反馈',
                    notCache: true,
                },
                component: () =>
                    import('@/view/feed_back/index.vue'),
            },
            {
                path: 'modify_password',
                name: 'modify_password',
                meta: {
                    icon: 'md-apps',
                    title: '修改密码',
                    notCache: true,
                },
                component: () =>
                    import('@/view/user/modify_password.vue'),
            },
        ],
    },
    {
        path: '/argu',
        name: 'argu',
        meta: {
            hideInMenu: true,
        },
        component: Main,
        children: [{
                path: 'params/:id',
                name: 'params',
                meta: {
                    icon: 'md-flower',
                    title: '动态路由',
                    notCache: true,
                },
                component: () =>
                    import('@/view/argu-page/params.vue'),
            },
            {
                path: 'query',
                name: 'query',
                meta: {
                    icon: 'md-flower',
                    title: '带参路由',
                    notCache: true,
                },
                component: () =>
                    import('@/view/argu-page/query.vue'),
            },
        ],
    },
    {
        path: '/401',
        name: 'error_401',
        meta: {
            hideInMenu: true,
        },
        component: () =>
            import('@/view/error-page/401.vue'),
    },
    {
        path: '/500',
        name: 'error_500',
        meta: {
            hideInMenu: true,
        },
        component: () =>
            import('@/view/error-page/500.vue'),
    },
    {
        path: '*',
        name: 'error_404',
        meta: {
            hideInMenu: true,
        },
        component: () =>
            import('@/view/error-page/404.vue'),
    },
]
